@extends('layout.adminlayout')
@section('css')
    <script src="/admin/js/metisMenu.min.js"></script>
    <script src="/admin/js/custom.js"></script>
    <link href="/admin/css/custom.css" rel="stylesheet">
@endsection
@section('content')
<div class="tables">
                <div class="table-responsive bs-example widget-shadow">
                    <h4>区域列表 :</h4>
                    <form action="/admin/area/index" method="get">
                        <div class="row" style="padding-bottom: 15px;margin-top: 0px;">
                            <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px;float: left;    top: 5px;">代理商：</p>
                            <select name="ag" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD; margin: 5px 10px; width: 64%;float: right;">
                                <option value="">请选择代理商</option>
                                @foreach($agent as $v)
                                    <option value="{{$v['id']}}"
                                            @if($get['ag'] == $v['id'])
                                            selected
                                            @else
                                            @if(Cookie::get('agentId') == $v['id'])
                                            selected
                                            @endif
                                            @endif>{!! $v['agent_name'] !!}</option>
                                @endforeach
                            </select>
                            <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px;float: left;top: 5px;">区域：</p>
                            <input type="text" name="area" id="" value="{{$get['area']}}" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD; margin: 0px 10px; width: 64%;float: right;" />
                            <input type="submit" value="搜索" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 32px; line-height: 32px; padding: 0px; border: 0; background: #4F52BA;width: 91%; margin: 0 auto;color:#fff;top: 5px;margin-left: 15px" />
                        </div>
                    </form>
                    <table class="table table-bordered">
                        <tbody>
                        @if(!null==$info)
                            @foreach($info as $v)
                                <tr>
                                </tr>
                                <tr>
                                    <th style="text-align: center">区域编号</th>
                                    <th scope="row" style="text-align: center">{{$v['a_id']}}</th>
                                </tr>
                                <tr>
                                    <th style="text-align: center">区域名称</th>
                                    <td style="text-align: center">{{$v['a_name']}}</td>
                                </tr>
                                <tr>
                                    <th style="text-align: center">负责人</th>
                                    <th scope="row" style="text-align: center">{{$v['mma_username']}}</th>
                                </tr>
                                @if($get['ag'] == Cookie::get('agentId') || Cookie::get('agentId') == 1)
                                <tr>
                                    <th style="text-align: center">操作</th>
                                    <td style="text-align: center">
                                        <a href="/admin/area/edit?a_id={{$v['a_id']}}">修改</a>|<a href="/admin/area/delete?id={{base64_encode($v['a_id'])}}">删除</a>
                                    </td>
                                </tr>
                                @endif
                            @endforeach
                        @endif
                        </tbody>
                    </table>
                    @if(!null == $data)
                        <div style="float:right;">
                            {!! $data->appends($request)->render() !!}
                        </div>
                    @endif
                </div>
            </div>
@endsection